package com.headingdata.encapsulation;

public class Student {
    private String name;
    private double score;

    public Student() {
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public double getScore() {
        return score;
    }

    public void setScore(double score) {
        if(score < 0 || score > 100){
            System.out.println("您设置的成绩不在1-100范围内！");
        }else {
            this.score = score;
        }
    }
}
